﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JXT.PrimaryKey.Batman.Language;
using JXT.PrimaryKey.Batman.Validation;
using JXT.PrimaryKey.Batman.Core.Infrastructure;

namespace JXT.PrimaryKey.Batman.WcfService.Services.Extensions
{
    public static class ValidationExtensions
    {
        public static void LocalMessage(this SupernovaContext context, ValidationErrorCollection errors)
        {
            errors.LocalizeMessage((key, message) =>
            {
                return context.Language.Localize(key, message, context.CultureInfo);
            });
        }
    }
}
